Matthias Clasen [Sat, 4 Jan 2020 16:07:54 +0000 (11:07 -0500)]
wayland: Don't artificially prefer ASK
We were always adding ASK to the list of possible
actions, and preferring it. This was causing the
ask cursor to show up when both the source and
the target support ASK, even though it is only
meant to happen if you hold the Alt modifier.
Instead, use one of the supported actions as
preferred action.
Matthias Clasen [Sat, 4 Jan 2020 14:14:33 +0000 (09:14 -0500)]
wayland: Finish pending offer handling
When creating a new GdkDrop object on drag_enter, take pending
source_actions and action into account. The code to store the
pending actions was already there, they were just not passed
on to the drop object when we create it.
Matthias Clasen [Sat, 4 Jan 2020 05:12:57 +0000 (00:12 -0500)]
wayland: Clean up drags
We need to set the drag to NULL in gdk_wayland_drag_drop_done,
otherwise, all future drags will be considered local after the
first local one. Worse, they will also provide the wrong data.
Matthias Clasen [Fri, 3 Jan 2020 17:43:30 +0000 (12:43 -0500)]
textview: Render visible marks better
The only other visible mark that is in common use
besides insert and selection_bound is dnd_mark, and
we don't want it to blink or be affected by 'cursor'
visibility.
Therefore, cache not just the cursor positions, but
also whether they are insert or selection_bound,
and take that into account when rendering them.
Matthias Clasen [Tue, 31 Dec 2019 21:03:33 +0000 (16:03 -0500)]
dnd: Be safer
The contents of the selection are documented
to not be NULL if size is non-negative. So
use an empty string instead of NULL for size 0,
avoiding a crash.
Matthias Clasen [Mon, 30 Dec 2019 16:58:11 +0000 (11:58 -0500)]
gdk: Populate dnd event coords
The GdkDrop emit... apis take root coordinates.
That should be changed to surface coordinates,
eventually. For now, make the functions fill
the x, y fields.
Matthias Clasen [Mon, 30 Dec 2019 16:56:49 +0000 (11:56 -0500)]
gdk: Fix coordinates in dnd events
Don't store coordinates as shorts. Use doubles,
as everywhere else. Also add x, y in addition
to x_root, y_root, and actually return those
in gdk_event_get_coords.
Matthias Clasen [Mon, 30 Dec 2019 14:52:13 +0000 (09:52 -0500)]
tooltip: Never set a window to be its own parent
We do get events on the tooltip window too, and
we better ignore them, or bad things may happen,
such as widgets that are their own parents and
cause infinite loops.
Matthias Clasen [Mon, 30 Dec 2019 03:47:26 +0000 (22:47 -0500)]
Add GtkDragIcon
This is a GtkRoot implemntation for drag icons,
using the surface provided by GdkDrag. This lets
us avoid GTK_WINDOW_POPUP and
gtk_window_set_hardcoded_surface.
Matthias Clasen [Sat, 28 Dec 2019 17:57:17 +0000 (12:57 -0500)]
treeview: Use a popover for search
This is a more modern way of doing things, and avoids a window
of type GTK_WINDOW_POPUP. With a popover, it doesn't make sense
to have a positioning function, so remove that api.
Matthias Clasen [Fri, 27 Dec 2019 06:32:27 +0000 (01:32 -0500)]
toolbar: Simplify overflow implementation
Do away with the proxy menu items, and instead
just have toolitems provide a label for overflow
items. We create the overflow widgets ourselves
already, as model buttons.
Also replace the toggle button used for overflow
with a menubutton, simplifying things further.
Matthias Clasen [Sat, 28 Dec 2019 16:02:49 +0000 (11:02 -0500)]
gtk-demo: Remove the change display demo
The window picking code has been broken for a while.
Since this is not really functionality that we should
highlight to application developers, remove the demo
instead of patching it up.
Matthias Clasen [Fri, 27 Dec 2019 03:04:23 +0000 (22:04 -0500)]
gtk-demo: Remove a somewhat silly bit of code
Putting a context menu on an overlay scrollbar
is too much of an easter egg to count as a useful
demo. Remove it, rather than changing it to a
popover.
Matthias Clasen [Thu, 26 Dec 2019 14:29:36 +0000 (09:29 -0500)]
filechooserbutton: Be smarter about 'None'
Don't refilter the model while the combo box is popped up,
that wreaks havoc with layout and does not really work.
Instead, repurpose one of the separator rows for the 'none'
case. This works because the row separator function is not
consulted for the cellview in the button.